﻿using LPLS.Commons.DBModule;
using LPLS.Commons.Enums;
using LPLS.DBEntities.ConfigModels.AlarmModels;
using LPLS.DBEntities.ConfigModels.AlarmModels.AlarmVarableCodeRuleConfigModels;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LPLS.DBEntities.OEEModule.OEEModels.DataStatisticModels
{
    [DatabaseKey(DatabaseEnum.CollectionDataResult)]
    [SugarTable(nameof(AlarmDataStatistic))]
    public  class AlarmDataStatistic
    {
        public AlarmDataStatistic()
        {
            AlarmVarableContent = new AlarmVarableCodeConfig();
            AlarmVarableCodeRule = new AlarmVarableCodeRuleConfig();
        }

        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int ID { get; set; }
        public string AlarmCode { get; set; }
        [SugarColumn(IsIgnore = true)]
        public string AlarmCodeName { get; set; }
        [SugarColumn(IsIgnore =true)]
        public string AlarmMessage { get; set; }
        [SugarColumn(IsIgnore =true)]
        public int AlarmLevel { get; set; }

        public DateTime  StartTime { get; set; }

        public DateTime EndTime { get; set; }
        /// <summary>
        /// 设备ID
        /// </summary>
        public Guid  DeviceID { get; set; }
        [SugarColumn(IsIgnore = true)]
        public string DeviceName { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public StatusEnum Status { get; set; }
        [SugarColumn(IsIgnore = true)]
        public string DeviceStatusDesc { get; set; }

        /// <summary>
        /// 持续时间 秒
        /// </summary>
        public int TotalSecondTime { get; set; }

        /// <summary>
        /// 根据AlarmCode 获取相关详细信息
        /// </summary>
        [SugarColumn(IsIgnore =true)]
        public AlarmVarableCodeConfig AlarmVarableContent{ get; set; }
        /// <summary>
        /// 器件规则配置
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public AlarmVarableCodeRuleConfig  AlarmVarableCodeRule { get; set; }


    }
}
